#include <climits>
#include <iostream>
#include <string>
using namespace std;
 
int main()
{
    string str;
    cin >> str;
    int sz = str.size();
    int maxLen = 0;
    int begin = 0, end = 0;
    for(int left = 0, right = 0; left < sz && right < sz;)
    {
        while(left < sz && (str[left] > '9' || str[left] < '0')) // 是字母就循环
        {	// 或的两个没加括号直接数组越界。。。。
            ++left; // 找数字区间的左边
        }
        right = left;
        while(right < sz && str[right] >= '0' && str[right] <= '9') // 是数字就循环
        {
            ++right; // 找数字区间的右边
        }
        int len = right - left;
        // cout << "len : " << len << " " << left << " " << right << " sz " << sz << endl;
        if(len > maxLen && left < sz && right <= sz)
        {
            // string tmp(str.begin() + left, str.begin() + right);
            // cout << tmp << endl;
            // cout << left << " " << right << " sz " << sz << endl;
            end = right;
            begin = left;
            maxLen = len;
        }
        left = right;
    }
    string ret(str.begin() + begin, str.begin() + end);
    cout << ret << endl;
    return 0;
}